package com.showsu.editor.entity.platform.xhs;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Author: William
 * @Description:
 * @Date: Created in 8:34 下午 2023/6/19
 * @Modified By:
 */
@Data
public class AwemeDetailPlatformDataResult implements Serializable {
    private String track_id;
    private String model_type;
    private User user;
    private List<Note> note_list;

    @Data
    public class User implements Serializable {
        private String image;
        private String name;
        /**
         * 达人昵称
         */
        private String nickname;
        private Integer red_official_verify_type;
        private String id;
        private Boolean followed;
        private String userid;
        private String red_id;
    }

    @Data
    public class Note implements Serializable {
        private Boolean enable_fls_bridge_cards;
        /**
         * 点赞量，上层业务从这个字段拿点赞量
         */
        private Integer liked_count;
        /**
         * 点赞量，个别接口的点赞量字段用的是这个，记得要把它塞到liked_count里，否则上层业务拿不到点赞量
         */
        private Integer likes;
        private Boolean collected;
        private ShareInfo share_info;
        /**
         * 标题
         */
        private String title;
        /**
         * 发布时间，10位时间戳
         */
        private Long time;
        /**
         * 有些响应里没有time字段，就用create_time代替，10位时间戳
         */
        private Long create_time;
        /**
         * 最近更新时间，10位时间戳
         */
        private Long last_update_time;
        /**
         * 笔记类型，video-视频、normal-图文
         */
        private String type;
        /**
         * 该字段不为空，则代表是带货笔记
         */
        private String goodsId;
        /**
         * 收藏量
         */
        private Integer collected_count;
        /**
         * 评论量
         */
        private Integer comments_count;
        /**
         * 分享量，上层业务从这个字段拿分享量
         */
        private Integer shared_count;
        /**
         * 分享量，个别接口的分享量字段用的是这个，记得要把它塞到shared_count里，否则上层业务拿不到分享量
         */
        private Integer share_count;

        private String desc;

        private String widgets_context;

        private List<Image> images_list;

        private String text;

        private List<XhsAwemeHashTagDTO> hash_tag;

        @SerializedName("video")
        private VideoDTO video;

        @Data
        public class ShareInfo implements Serializable {
            /**
             * 封面图
             */
            private String image;
            private String link;
            private Boolean is_star;
            private String title;
            private Boolean guide_audited;
            private String content;
            private List<FunctionEntry> function_entries;

            @Data
            public class FunctionEntry implements Serializable {
                private String type;
                private String link;

            }
        }

        @Data
        public class Image implements Serializable {
            private String fileid;
            private Integer height;
            private Integer width;
            private String url;
            private String url_size_large;
            private String original;
            private UrlMultiLevel url_multi_level;
            private String trace_id;
            private String live_photo_file_id;
            private LivePhoto live_photo;
            private LivePhoto.Media.Stream stream;
            private Boolean need_load_original_image;
            private Double scale_to_large;

            @Data
            private class UrlMultiLevel implements Serializable {
                private String low;
                private String medium;
                private String high;
            }

            @Data
            public class LivePhoto implements Serializable {
                private Media media;

                @Data
                public class Media implements Serializable {
                    private Stream stream;
                    private Integer user_level;
                    private String video_id;

                    @Data
                    public class Stream implements Serializable {
                        private List<H264> h264;
                        private List<H264> h265;

                        @Data
                        public class H264 implements Serializable {
                            private String master_url;
                            private String masterUrl;
                        }
                    }

                }
            }
        }

        @Data
        public class VideoDTO {
//            @SerializedName("avg_bitrate")
//            private Integer avgBitrate;
//            @SerializedName("can_super_resolution")
//            private Boolean canSuperResolution;
            @SerializedName("duration")
            private Integer duration;
//            @SerializedName("first_frame")
//            private String firstFrame;
//            @SerializedName("frame_ts")
//            private Integer frameTs;
//            @SerializedName("height")
//            private Integer height;
            @SerializedName("id")
            private String id;
//            @SerializedName("is_upload")
//            private Boolean isUpload;
//            @SerializedName("is_user_select")
//            private Boolean isUserSelect;
//            @SerializedName("played_count")
//            private Integer playedCount;
//            @SerializedName("preload_size")
//            private Integer preloadSize;
//            @SerializedName("thumbnail")
//            private String thumbnail;
//            @SerializedName("thumbnail_dim")
//            private String thumbnailDim;
            @SerializedName("url")
            private String url;
//            @SerializedName("url_info_list")
//            private List<UrlInfoListDTO> urlInfoList;
//            @SerializedName("vmaf")
//            private Integer vmaf;
//            @SerializedName("volume")
//            private Integer volume;
//            @SerializedName("width")
//            private Integer width;

            @Data
            public class UrlInfoListDTO {
                @SerializedName("avg_bitrate")
                private Integer avgBitrate;
                @SerializedName("desc")
                private String desc;
                @SerializedName("height")
                private Integer height;
                @SerializedName("url")
                private String url;
                @SerializedName("vmaf")
                private Integer vmaf;
                @SerializedName("width")
                private Integer width;
            }
        }
    }
}

